#ifndef __KFunction_h__
#define __KFunction_h__

#include "kscbase.h"

class KFunction
{
public:
	static CString GetModulePath(HMODULE hModule);
	static void PathAddBackslash(CString& strPath);
	static void PathRemoveFileSpec(CString& strPath);
	static BOOL CreateDeepDirectory(LPCTSTR szPath);
	static UINT GetFileCrc32(HANDLE hFile);
	static int RunApp(LPCTSTR szPath, LPCTSTR szCmd, DWORD dwWaitTime = 0, BOOL bShow = TRUE);
	
	static BOOL IsProcessRunning(LPCTSTR szPath);
	static BOOL IsProcessRunningByFile(LPCTSTR szFileName);
	static BOOL IsProcessRunningByDirectory(LPCTSTR szPath);
	static BOOL GetDebugPrivilege(void);
	static BOOL IsWow64();
	static BOOL RebootSystem();
	static int  KillProcessByPath(LPCTSTR szPath, int* pnKillCount = NULL, BOOL bDirectory = FALSE);
	static BOOL DeleteFolder(LPCTSTR szPath, BOOL bDeleteDriver, BOOL bForce);
	static CString GetDriversPath(void);
	static BOOL IsDriverFile(CString& strFileName);
	static BOOL UninstallOldProduct(LPCTSTR szPath);
	static BOOL EnableWow64FsRedirection(BOOL bEnable);

	static BOOL GetKavAppDataPath(std::wstring& strPath);
	static CString GetModuleFileName(HMODULE hModule);
	static int GetPEFileVersion(LPCTSTR szFileName, DWORD* pdwHighVersion, DWORD* pdwLowVersion);
	static BOOL IsWinXPAndLater();
	static LONG DeleteSubKeyTree(HKEY hKey, LPCTSTR lpSubKey);
	static CString GetLogFilePath();

	static void WriteSetupInfo(IN int nInstallType, IN BOOL bSilent, IN int time);
	static BOOL LoadFileToString(LPCTSTR szFilePath, CStringA& strBuffer);

	static BOOL WriteCoverInstallRebootFlag();
	static BOOL IsCoverInstallNeedReboot();
	static BOOL WriteCoverInstall11Flag();

};


#endif